<div class="row">
  <div class='col-lg-2 pull-right'>
    <a href="/admin/flowtasks/new">
      <button class="btn btn-primary col-lg-12 btn-large">
        <i class="glyphicon glyphicon-plus"></i> 新建
      </button>
    </a>
  </div>
</div>
<hr>
<div class="row">
  <form role="form" accept-charset="UTF-8" action="/admin/flowtasks" method="GET">
    <div class="col-lg-3">
      <div class="form-group">
        <label>标题</label>
        <input class="form-control" name="title" value="{{ query.title }}">
      </div>
    </div>
    <div class="col-lg-3">
      <div class="form-group">
        <label>商家</label>
        {{ selectTag sellerOptions sellerCollection query.sellerId }}
      </div>
    </div>
    <div class="col-lg-3">
      <div class="form-group">
        <label>状态</label>
        {{ selectTag isActiveOptions isActiveCollection query.isActive }}
      </div>
    </div>
    <div class="col-lg-3" style="padding-top: 19px;">
      <div class="form-group">
        <button type='submit' class="btn btn-info col-lg-8 pull-right">搜索</button>
      </div>
    </div>
  </form>
</div>
<hr>
<div class="row">
  <div class="col-lg-12">
    <div class="panel panel-default">
      <div class="panel-heading">
          流量任务
      </div>
      <!-- /.panel-heading -->
      <div class="panel-body">
        <div class="table-responsive">
          <table class="table table-striped">
            <thead>
              <tr>
                  <th>标题</th>
                  <th>商家</th>
                  <th>奖励 (M)</th>
                  <th>排序</th>
                  <th>完成次数</th>
                  <th>活动状态</th>
                  <th>过期时间</th>
                  <th></th>
              </tr>
            </thead>
            <tbody>
              {{#each flowtasks.rows }}
                <tr>
                    <td>{{ title }}</td>
                    <td>{{ seller.name }}</td>
                    <td>{{ trafficPlan.name }}</td>
                    <td>{{ sortNum }}</td>
                    <td>{{ finishTime }}</td>
                    <td>{{ isActive }}</td>
                    <td>{{ strftime expiredAt }}</td>
                    <td>
                      <a href="/admin/flowtasks/{{id}}/edit" class="list-group-item">
                        <i class="glyphicon glyphicon-pencil"></i>
                      </a>
                    </td>
                </tr>
              {{/each}}
            </tbody>
          </table>
        </div>
        <!-- /.table-responsive -->

      </div>

      <div class="panel-footer">
          {{pagination flowtasks '/admin/flowtasks'}}
      </div>
      <!-- /.panel-body -->
    </div>
    <!-- /.panel -->
  </div>
</div>